package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Lenovo on 2017/12/7.
 */
@Entity
@Table(name = "T_SYS_ROLE_NAME", schema = "oa", catalog = "")
public class RoleNameEntity extends BaseEntity {
    private String name;
    private Integer frontFlag;
    private Integer areaType;//是否配置区域
    private String templateId;
    private String reportTemplateId;
    private Integer sortNo;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getFrontFlag() {
        return frontFlag;
    }

    public void setFrontFlag(Integer frontFlag) {
        this.frontFlag = frontFlag;
    }

    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    public Integer getAreaType() {
        return areaType;
    }

    public void setAreaType(Integer areaType) {
        this.areaType = areaType;
    }

    public String getReportTemplateId() {
        return reportTemplateId;
    }

    public void setReportTemplateId(String reportTemplateId) {
        this.reportTemplateId = reportTemplateId;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public JSONObject getJSONObject(){
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("NAME", this.getName());
        obj.put("DEL_FLAG", this.getDelFlag());
        obj.put("FRONT_FLAG",this.getFrontFlag());
        obj.put("TEMPLATE_ID",this.getTemplateId());
        obj.put("AREA_TYPE",this.getAreaType());
        obj.put("REPORT_TEMPLATE_ID",this.getReportTemplateId());
        obj.put("SORT_NO",this.getSortNo());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_SYS_ROLE_NAME";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("NAME", "name");
        obj.put("DEL_FLAG", "delFlag");
        obj.put("FRONT_FLAG","frontFlag");
        obj.put("TEMPLATE_ID","templateId");
        obj.put("AREA_TYPE","areaType");
        obj.put("REPORT_TEMPLATE_ID","reportTemplateId");
        obj.put("SORT_NO","sortNo");
        return obj;
    }
}
